3.291 \(\int \sqrt{-1-\tan ^2(x)} \, dx\)

Optimal. Leaf size=16 \[ -\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{-\sec ^2(x)}}\right ) \]

[Out]

-ArcTan[Tan[x]/Sqrt[-Sec[x]^2]]

________________________________________________________________________________________

Rubi [A]  time = 0.0173641, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {3657, 4122, 217, 203} \[ -\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{-\sec ^2(x)}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[Sqrt[-1 - Tan[x]^2],x]

[Out]

-ArcTan[Tan[x]/Sqrt[-Sec[x]^2]]

Rule 3657

Int[(u_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*sec[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a, b]

Rule 4122

Int[((b_.)*sec[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(b*ff)
/f, Subst[Int[(b + b*ff^2*x^2)^(p - 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{b, e, f, p}, x] &&  !IntegerQ[p
]

Rule 217

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

\begin{align*} \int \sqrt{-1-\tan ^2(x)} \, dx &=\int \sqrt{-\sec ^2(x)} \, dx\\ &=-\operatorname{Subst}\left (\int \frac{1}{\sqrt{-1-x^2}} \, dx,x,\tan (x)\right )\\ &=-\operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\frac{\tan (x)}{\sqrt{-\sec ^2(x)}}\right )\\ &=-\tan ^{-1}\left (\frac{\tan (x)}{\sqrt{-\sec ^2(x)}}\right )\\ \end{align*}

Mathematica [B]  time = 0.0069509, size = 46, normalized size = 2.88 \[ \cos (x) \sqrt{-\sec ^2(x)} \left (\log \left (\sin \left (\frac{x}{2}\right )+\cos \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )-\sin \left (\frac{x}{2}\right )\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[-1 - Tan[x]^2],x]

[Out]

Cos[x]*(-Log[Cos[x/2] - Sin[x/2]] + Log[Cos[x/2] + Sin[x/2]])*Sqrt[-Sec[x]^2]

________________________________________________________________________________________

Maple [A]  time = 0.029, size = 17, normalized size = 1.1 \begin{align*} -\arctan \left ({\tan \left ( x \right ){\frac{1}{\sqrt{-1- \left ( \tan \left ( x \right ) \right ) ^{2}}}}} \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1-tan(x)^2)^(1/2),x)

[Out]

-arctan(tan(x)/(-1-tan(x)^2)^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.84511, size = 23, normalized size = 1.44 \begin{align*} \arctan \left (\cos \left (x\right ), \sin \left (x\right ) + 1\right ) + \arctan \left (\cos \left (x\right ), -\sin \left (x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="maxima")

[Out]

arctan2(cos(x), sin(x) + 1) + arctan2(cos(x), -sin(x) + 1)

________________________________________________________________________________________

Fricas [C]  time = 1.87246, size = 55, normalized size = 3.44 \begin{align*} i \, \log \left (e^{\left (i \, x\right )} + i\right ) - i \, \log \left (e^{\left (i \, x\right )} - i\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="fricas")

[Out]

I*log(e^(I*x) + I) - I*log(e^(I*x) - I)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \sqrt{- \tan ^{2}{\left (x \right )} - 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1-tan(x)**2)**(1/2),x)

[Out]

Integral(sqrt(-tan(x)**2 - 1), x)

________________________________________________________________________________________

Giac [C]  time = 1.09306, size = 9, normalized size = 0.56 \begin{align*} i \, \arcsin \left (i \, \tan \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1-tan(x)^2)^(1/2),x, algorithm="giac")

[Out]

I*arcsin(I*tan(x))